import { sleepRand } from "../utils/time";
import { moheAPI } from "./api";
import { DrawResult } from "./type";
import { http } from "./user";

export const draw = async (): Promise<DrawResult> => {
  await sleepRand(0, 1500);
  await http.get(moheAPI.drawPrizeList);
  await sleepRand(0, 1500);
  await http.get(moheAPI.drawIndex);
  await sleepRand(1000, 3000);
  let result = await http.post(moheAPI.drawResult);
  return result.data;
};
